home *** CD-ROM | disk | FTP | other *** search
- VERSION 1.0 CLASS
- BEGIN
- MultiUse = -1 'True
- END
- Attribute VB_Name = "ObjSquare"
- Attribute VB_Creatable = False
- Attribute VB_Exposed = False
- Option Explicit
-
- Public x As Single
- Public y As Single
- Public r As Single
-
- ' ************************************************
- ' Compute the world coordinate bounds for the
- ' square.
- ' ************************************************
- Sub Bound(xmin As Single, ymin As Single, xmax As Single, ymax As Single)
- xmin = x - r
- xmax = x + r
- ymin = y - r
- ymax = y + r
- End Sub
-
- ' ************************************************
- ' Write a square to a file using Write.
- ' Begin with "SQUARE" to identify this object.
- ' ************************************************
- Sub FileWrite(filenum As Integer)
- Write #filenum, "SQUARE", x, y, r
- End Sub
- Function ObjectType() As String
- ObjectType = "SQUARE"
- End Function
-
-
-
- ' ************************************************
- ' Draw the square on a Form, Printer, or
- ' PictureBox.
- ' ************************************************
- Sub Draw(canvas As Object)
- canvas.Line (x - r, y - r)-(x + r, y + r), , B
- End Sub
-
- ' ************************************************
- ' Read a square from a file using Input.
- ' Assume the "SQUARE" label has already been read.
- ' ************************************************
- Sub FileInput(filenum As Integer)
- Input #filenum, x, y, r
- End Sub
-
-